import React, { useContext } from "react";
// 6，孙子组件中导入context对象
import context from "../context.js";
export default function son() {
  // 7，使用useContext hook函数，解析出context对象中绑定的value数据
  // let data = useContext(context)
  let { username, age } = useContext(context);
  return (
    <div>
      <h3>Son组件</h3>
      <p>
        constext传递过来的数据: {username},{age}
      </p>
    </div>
  );
}
